

package com.hazelcast.internal.networking;

public enum HandlerStatus {

    /**
     * The handler has processed all data it could process and there is nothing
     * left for this handler to do.
     * <p>
     * For example a Packet was fully written and there is nothing else to write.
     * <p>
     * Or when all data from the input buffer has been consumed and there is nothing
     * left to produce.
     */
    CLEAN,

    /**
     * There is something left in the handler that could be processed with another
     * call.
     * <p>
     * For example a packet larger than the socket buffer needs to be written, so
     * it will require multiple calls for the handler to get this packet written.
     * <p>
     * As long as the handler has not fully written the packet, it will keep
     * returning dirty.
     */
    DIRTY,

    /**
     * The handler will not accept any new reads until some external condition
     * has been met. For example for TLS Hostname verification, a handler could
     * create a task executed on some thread that does the hostname verification
     * and as a result it will return BLOCKED to indicate that this handler will
     * not produce/consume any data. So there is no point trying.
     */
    BLOCKED
}
